<template>
    <div>
        <van-nav-bar fixed="true" title="案例管理" left-text="返回" left-arrow="" @click-left="onClickLeft">
        </van-nav-bar>
        <!--        选择案例类型-->
        <van-grid :gutter="10" style="padding-bottom: 22px;margin-top: 46px" icon-size="78px" clickable true>
            <van-cell @click="toList(1)" :key="value" text="文字"><p style="text-align: center">行政案例管理</p></van-cell>
            <van-cell @click="toList(2)" :key="value" text="文字"><p style="text-align: center">经济案例管理</p></van-cell>
            <van-cell @click="toList(3)" :key="value" text="文字"><p style="text-align: center">民事案例管理</p></van-cell>
            <van-cell @click="toList(4)" :key="value" text="文字"><p style="text-align: center">刑事案例管理</p></van-cell>
            <van-cell @click="toAdd"><p style="text-align: center">添加一条案例</p></van-cell>
        </van-grid>
    </div>
</template>

<script>
    export default {
        name: "caseManager",
        data() {
            return {
                caseLists: [],
                show: false,
                show1: false,


            }
        },
        methods: {
            onClickLeft() {
                this.$router.push({path: 'adminHome'})
            },
            showPopup() {
                this.show = true;
            },
            showPopup1() {
                this.show1 = true;
            },
            toList(id) {
                this.$router.push({path: "/caseListManager", query: {id: id}})
            },
            toAdd(){
                this.$router.push('/caseAddManager')
            },
            caseList() {
                if (this.$route.query.id == 1) {
                    this.$axios.post('/case/getCaseList', {"lawCaseKind": "行政案例"}, res => {
                        console.log(res)
                        this.caseLists = res.data.data
                    })
                } else if (this.$route.query.id == 2) {
                    this.$axios.post('/case/getCaseList', {"lawCaseKind": "经济案例"}, res => {
                        console.log(res)
                        this.caseLists = res.data.data
                    })
                } else if (this.$route.query.id == 3) {
                    this.$axios.post('/case/getCaseList', {"lawCaseKind": "民事案例"}, res => {
                        console.log(res)
                        this.caseLists = res.data.data
                    })
                } else if (this.$route.query.id == 4) {
                    this.$axios.post('/case/getCaseList', {"lawCaseKind": "刑事案例"}, res => {
                        console.log(res)
                        this.caseLists = res.data.data
                    })
                }
            },
            created() {
                this.caseList()
            }
        }
    }
</script>

<style scoped>

</style>
